<?php
/**
 * Created by PhpStorm.
 * User: D
 * Date: 2019/5/11
 * Time: 8:58
 */

function dbHelper($sql){
    $dbhost = "127.0.0.1";
    $usename = "root";
    $dbpassword = "";
    $dbname = "mlh";
    $dbport = "3306";
    //创建连接
    $conn = new mysqli($dbhost, $usename, $dbpassword, $dbname, $dbport);
    //创建字符集连接
    mysqli_query($conn, "set names utf8");
    //执行查询
    $relust = $conn->query($sql);
    $conn->close();
    return $relust;


}











